package net.qiqbframework.loadhanding;

import net.qiqbframework.messaging.BatchMessage;

/**
 * 批量加载
 *
 * @param <BID> 业务ID
 * @param <A>
 */
public class BatchLoadMessages<BID, A> extends BatchMessage<LoadMessage<BID, A>> {

    private Class<A> aggregateRootType;

    private Class<BID> bizIdentifierType;

    public BatchLoadMessages(Class<LoadMessage<BID, A>> messageType) {
        super(messageType);

    }

    public Class<A> getAggregateRootType() {
        return aggregateRootType;
    }

    public Class<BID> getBizIdentifierType() {
        return bizIdentifierType;
    }

    @Override
    public void addMessage(LoadMessage<BID, A> idaLoadMessage) {
        super.addMessage(idaLoadMessage);
        this.bizIdentifierType = idaLoadMessage.getPayloadType();
        this.aggregateRootType = idaLoadMessage.getAggregateType();
    }
}
